<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>登录</title>
     
    <script type="text/javascript">
    	//修改图片(修改之前需要先拿到这张图片)
    	function changeImg(img){
    		//console.debug(document.getElementById("myImg"));
    		//如果请求相同，会找缓存中的数据，就不会重新发送 
    		//每次请求产生不同的产生提交
    		img.src = "/xiaomi/randomCode?code="+Math.random();
    	}
    </script>
     
    </head>
    <body>
    	<span style="color:red;">${errorMsg}</span>
    	<form action="/xiaomi/randomCodes" method="post">
    		姓名：<input type="text" name="username" /> <br />
    		密码：<input type="password" name="password" /> <br />
    		验证码:<input type="text" name="code" /> 
    				<img src="/xiaomi/randomCode" style="cursor:pointer;"
    					 title="点我替换.." onclick="changeImg(this)" /> <br />
    		<input type="submit" value="登录" />
    	</form>
    </body>
    </html>